using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using YB.EnterpriseLibrary.XSLTManager.Configuration.Design.Properties;

namespace YB.EnterpriseLibrary.XSLTManager.Configuration.Design
{
    class XSLTCommandRegistrar : CommandRegistrar
    {
        public XSLTCommandRegistrar(IServiceProvider serviceProvider) : base(serviceProvider)
        {

        }

        public override void Register()
        {
            AddXSLTManagerSettingsCommand();
            AddDefaultCommands(typeof(XSLTManagerSettingsNode));

            AddXSLTManagerCommand();
            AddDefaultCommands(typeof(XSLTManagerNode));
        }

        private void AddXSLTManagerCommand()
        {
            AddMultipleChildNodeCommand(Resources.XSLTManagerUICommandText,
                Resources.XSLTManagerUICommandLongText, typeof(XSLTManagerNode),
                typeof(XSLTManagerNode), typeof(XSLTManagerSettingsNode));
        }

        private void AddXSLTManagerSettingsCommand()
        {
            ConfigurationUICommand cmd = ConfigurationUICommand.CreateSingleUICommand(ServiceProvider,
                Resources.XSLTSettingsUICommandText,
                Resources.XSLTSettingsUICommandLongText,
                new AddXSLTManagerSettingsNodeCommand(ServiceProvider),
                typeof(XSLTManagerSettingsNode));
            AddUICommand(cmd, typeof(ConfigurationApplicationNode));
        }
    }
}
